package com.qf.im.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qf.im.aspect.annotation.AuthReq;
import com.qf.im.dao.FriendshipDao;
import com.qf.im.entity.Friendship;
import com.qf.im.entity.User;
import com.qf.im.service.FriendshipService;
import com.qf.im.utils.UserUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 好友关系表(Friendship)表服务实现类
 *
 * @author makejava
 * @since 2023-10-31 10:26:06
 */
@Service("friendshipService")
public class FriendshipServiceImpl extends ServiceImpl<FriendshipDao, Friendship> implements FriendshipService {

    /**
     * 查询我的好友
     * @return
     */
    @Override
    @AuthReq
    public List<User> queryMyFriends() {
        //获取当前的用户ID
        Integer uid = UserUtils.getUid();

        //查询我的好友信息
        return getBaseMapper().queryMyFriends(uid);
    }
}

